package com.ruix.app.network.exception;

/**
 * Created by hadexs on 2017/4/13.
 */

public class RequestApiException extends Exception {

    private int errorCode;// 错误码
    private String responseString;// 服务端返回数据

    public RequestApiException(String errorMsg) {
        super(errorMsg);
    }

    public RequestApiException(int errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
    }

    public RequestApiException(int errorCode, String errorMsg, String responseString) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.responseString = responseString;
    }

    // 获取错误码
    public int getErrorCode() {
        return errorCode;
    }

    // 获取错误信息
    public String getErrorMsg() {
        return super.getMessage();
    }

    // 获取服务端返回数据
    public String getResponseString() {
        return responseString;
    }
}

